package bedside;

import java.io.Serializable;
import java.util.Random;

public class SteadySensor implements Sensor, Serializable {

	//Last Value
	int myLastValue = 50;
	
	@Override
	public int getVital() {
		Random rand = new Random();
		
		int diff = rand.nextInt(3);
		if(rand.nextBoolean() && myLastValue - diff > 0){
			myLastValue -= diff;
		}
		else if(myLastValue + diff < 100 ){
			myLastValue += diff;
		}
			
			
		return myLastValue;
	}

}
